import CryptoJS from 'crypto-js'

const key = 'EyyDbNl&uasSBfoG'
const iv = 'X28Y$Rw!ZVXYaQ6e'
// 加密处理
export const WJHEncrypt = async data => {
    const deData = { secret: 'U%USLMMcf3wtH$Wq', timestamp: new Date().getTime(), pageSize: 100, pageNum: 1 }
    data = { ...data, ...deData }
    let srcs = CryptoJS.enc.Utf8.parse(data)
    let encrypted = CryptoJS.AES.encrypt(srcs, key, { iv: iv, mode: CryptoJS.mode.CTR, padding: CryptoJS.pad.Pkcs7 })
    return encrypted.ciphertext.toString().toUpperCase()
}
